/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.bht.esa.weather.resourcemanager;

import de.bht.esa.weather.model.WetterComForecast;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Kombiniert einen aggregierten Wetterbericht (mit seiner Location <- Aggregation) mit der entsprechenden Resource-Id
 * 
 * @author Andreas Goese
 * @Sven Höche
 */
@XmlRootElement
@Entity
public class WeatherResourceEntity implements Serializable{
    private static final long serialVersionUID = 1234567891281990003L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Column(unique=true)
    private String resourceID;
    private WetterComForecast forecast;
    /**
     * Repräsentiert den Status der Ressource:
     * 0: unbearbeitet
     * 1: fertig mit Erfolg
     * -1: Fertig mit Fehler
     */
    private int state;

    public WeatherResourceEntity() {
    }
    
    public WeatherResourceEntity(String resourceID) {
        this.resourceID = resourceID;
        this.state = 0;
    }
    
    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getResourceID() {
        return resourceID;
    }

    public void setResourceID(String resourceID) {
        this.resourceID = resourceID;
    }

    public WetterComForecast getForecast() {
        return forecast;
    }

    public void setForecast(WetterComForecast forecast) {
        this.forecast = forecast;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
